package com.easy.west.westclient.api.push.api;

import android.content.Context;
import android.support.annotation.NonNull;

import com.easy.west.westclient.api.base.bean.SuccessBean;
import com.easy.west.westclient.api.base.callback.BaseCallBack;
import com.easy.west.westclient.api.base.impl.BaseImpl;
import com.easy.west.westclient.api.push.event.PushEvent;
import com.easy.west.westclient.util.UUIDGenerator;

/**
 *
 * Created by xiatao on 2018/8/22.
 */

public class PushImpl extends BaseImpl<PushService> implements PushApi{
    public PushImpl(@NonNull Context context) {
        super(context);
    }

    /**
     * 注释见接口
     * @param notification_title 推送标题
     * @param notification_alert 推送展示内容
     * @param msg_content  推送消息实体
     * @param extraskey type
     * @param extrasvalue  typeinfo
     * @param alias 别名
     * @return 唯一识别码
     */
    @Override
    public String push(String notification_title, String notification_alert, String msg_content, String extraskey, String extrasvalue, String... alias) {
        String uuid = UUIDGenerator.getUUID();
        service.push(notification_title,notification_alert,msg_content,extraskey,extrasvalue,alias)
        .enqueue(new BaseCallBack<SuccessBean>(new PushEvent(uuid)));
        return uuid;
    }
}
